package com.bootdo.system.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.bootdo.system.dao.ParentsMapper;
import com.bootdo.system.domain.Parents;
import com.bootdo.system.service.ParentsService;
import com.github.pagehelper.PageHelper;



@Service("parentsService")
public class ParentsServiceImpl implements ParentsService {
	@Autowired
	private ParentsMapper parentsMapper;
	
	@Override
	public Parents get(Long id){
		return parentsMapper.get(id);
	}
	
	@Override
	public List<Parents> list(Map<String, Object> map){
		PageHelper.startPage(Integer.parseInt(map.get("pageNum").toString()),Integer.parseInt(map.get("pageSize").toString()));
		return parentsMapper.list(map);
	}
	
	@Override
	public int count(Map<String, Object> map){
		return parentsMapper.getTotal(map);
	}
	
	@Override
	public int save(Parents bComments){
		return parentsMapper.save(bComments);
	}
	
	@Override
	public int update(Parents bComments){
		return parentsMapper.update(bComments);
	}
	
	@Override
	public int remove(Long id){
		return parentsMapper.remove(id);
	}
	
	@Override
	public int batchRemove( Integer[] ids){
		return parentsMapper.batchRemove(ids);
	}

	@Override
	public Parents getByOpenId(String openId) {
		return parentsMapper.getByOpenId(openId);
	}

	@Override
	public Double getConsumerTotal(Long id) {
		return parentsMapper.getConsumerTotal(id);
	}

	@Override
	public Integer getOrderNums(Long id) { 
		return parentsMapper.getOrderNums(id);
	}

}
